#pragma once
#include "PublicDefine.h"
#include <WinSock2.h>

LPFUNADDRDATA GetFunAddrData(FunNameID fn);
DWORD GetFunAddrID(FunNameID fn);

void PrintDebugString(const LPCSTR DebugStr,...);

//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
////MessageBoxW
////////////////////////////////////////////////////////////////////
typedef int (WINAPI *pMessageBoxW)(HWND, LPCWSTR, LPCWSTR, UINT);
int WINAPI HOOKMessageBoxW(HWND, LPCWSTR, LPCWSTR, UINT);
////////////////////////////////////////////////////////////////////


//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
////sendto
////////////////////////////////////////////////////////////////////
typedef int (PASCAL FAR *psendto)(IN SOCKET s,
						  IN const char FAR * buf,
						  IN int len,
						  IN int flags,
						  IN const struct sockaddr FAR *to,
						  IN int tolen);

int PASCAL FAR HOOKsendto(IN SOCKET s,
					  IN const char FAR * buf,
					  IN int len,
					  IN int flags,
					  IN const struct sockaddr FAR *to,
					  IN int tolen);
////////////////////////////////////////////////////////////////////



//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
////send
////////////////////////////////////////////////////////////////////
typedef int (PASCAL FAR *psend) (IN SOCKET s,
								 IN const char FAR * buf,
								 IN int len,
								 IN int flags);

int PASCAL FAR HOOKsend (IN SOCKET s,
					 IN const char FAR * buf,
					 IN int len,
					 IN int flags);
////////////////////////////////////////////////////////////////////




//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
////listen
////////////////////////////////////////////////////////////////////
typedef int (PASCAL FAR *plisten)(IN SOCKET s,
								  IN int backlog);

int PASCAL FAR HOOKlisten (IN SOCKET s,
					   IN int backlog);
////////////////////////////////////////////////////////////////////




//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
////listen
////////////////////////////////////////////////////////////////////
typedef int (PASCAL FAR *pbind) (IN SOCKET s,
								 IN const struct sockaddr FAR *addr,
								 IN int namelen);

int PASCAL FAR HOOKbind (IN SOCKET s,
						 IN const struct sockaddr FAR *addr,
						 IN int namelen);
////////////////////////////////////////////////////////////////////




//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
////connect
////////////////////////////////////////////////////////////////////
typedef int (PASCAL FAR *pconnect) (IN SOCKET s,
									IN const struct sockaddr FAR *name,
									IN int namelen);

int PASCAL FAR HOOKconnect (IN SOCKET s,
							IN const struct sockaddr FAR *name,
							IN int namelen);
////////////////////////////////////////////////////////////////////


//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
////recv
////////////////////////////////////////////////////////////////////
typedef int (PASCAL FAR *precv) (
					 IN SOCKET s,
					 __out_bcount_part(len, return) __out_data_source(NETWORK) char FAR * buf,
					 IN int len,
					 IN int flags);

int PASCAL FAR HOOKrecv (
					 IN SOCKET s,
					 __out_bcount_part(len, return) __out_data_source(NETWORK) char FAR * buf,
					 IN int len,
					 IN int flags);

////////////////////////////////////////////////////////////////////


//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
////recvfrom
////////////////////////////////////////////////////////////////////
typedef int (PASCAL FAR *precvfrom) (
						 IN SOCKET s,
						 __out_bcount_part(len, return) __out_data_source(NETWORK) char FAR * buf,
						 IN int len,
						 IN int flags,
						 __out_bcount(*fromlen) struct sockaddr FAR * from,
						 IN OUT int FAR * fromlen);


int PASCAL FAR HOOKrecvfrom (
						 IN SOCKET s,
						 __out_bcount_part(len, return) __out_data_source(NETWORK) char FAR * buf,
						 IN int len,
						 IN int flags,
						 __out_bcount(*fromlen) struct sockaddr FAR * from,
						 IN OUT int FAR * fromlen);


////////////////////////////////////////////////////////////////////
